/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.deliccio.entitys;

import java.io.Serializable;
import java.lang.reflect.Method;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Embeddable
public class PedidoMesaPK implements Serializable{
	
	private static final long serialVersionUID=1L;
	
	@Basic(optional=false)
	@Column(name="idmesa",nullable=false)
	private int idmesa;
	
	@Basic(optional=false)
	@Column(name="idpedido",nullable=false)
	private int idpedido;

	public PedidoMesaPK(){
	}

	public PedidoMesaPK(int idmesa,int idpedido){
		this.idmesa=idmesa;
		this.idpedido=idpedido;
	}

	public int getIdmesa(){
		return idmesa;
	}

	public void setIdmesa(int idmesa){
		this.idmesa=idmesa;
	}

	public int getIdpedido(){
		return idpedido;
	}

	public void setIdpedido(int idpedido){
		this.idpedido=idpedido;
	}

	  @SuppressWarnings("rawtypes")
		@Override
		public String toString() {
			String toString = "[";
			@SuppressWarnings("unused")
			String campo,iscampo = "";
			try {
				Class clase = this.getClass();
				Method[] metodos = clase.getDeclaredMethods();
				for (Method met:metodos) {					
					if (met.getName().indexOf("get") >= 0) {
						toString += met.getName()+"="+met.invoke(this, null)+" - ";
					}
				}								
				toString+="]";
			} catch (Exception e) {			
				System.out.println(e);
			}
			return toString;
		}
}
